package com.sgcc.fj.pmos.common.utils;


import android.text.TextUtils;

public class TextUtil {
    public static String getName(String name, String creditRating) {
        if (TextUtils.isEmpty(name)) {
            return "";
        }
        if (name.contains("信用等级") && !TextUtils.isEmpty(creditRating)) {
            int index = name.indexOf("信用等级");
            String substring = name.substring(0, index);
            String substring1 = name.substring(index + 4);
            return String.format("%s信用等级(%s)%s", substring, creditRating, substring1);
        } else {
            return name;
        }

    }
}
